/**
 * 
 */
package com.sdu.passager.bean;

import org.springframework.util.StringUtils;

/**
 * @author Administrator
 * 
 */
public class Field {

	private String name;// /getColumnName
	private int type;// /getColumnType
	private String className;// getColumnClassName
	private int displaySize;// getColumnDisplaySize
	private String typeName;// //getColumnTypeName
	private int isNull;// //isNullable
	private boolean isAutoIncrement;// //isAutoIncrement
	
	private String capName;///字段首字母大写
	private String isAutoIncrementStr;///转成String
	
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getClassName() {
		////处理下 对例如java.lang.String 取String
		return className.substring(className.lastIndexOf(".")+1);
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public int getDisplaySize() {
		return displaySize;
	}

	public void setDisplaySize(int displaySize) {
		this.displaySize = displaySize;
	}

	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public int getIsNull() {
		return isNull;
	}

	public void setIsNull(int isNull) {
		this.isNull = isNull;
	}

	public boolean isAutoIncrement() {
		return isAutoIncrement;
	}

	public void setAutoIncrement(boolean isAutoIncrement) {
		this.isAutoIncrement = isAutoIncrement;
	}

	public String getCapName() {
		if(org.apache.commons.lang.StringUtils.isNotEmpty(this.name)){
			return StringUtils.capitalize(this.name);
		}else
			return this.name;
	}

	public void setCapName(String capName) {
		this.capName = capName;
	}

	public String getIsAutoIncrementStr() {
		return String.valueOf(this.isAutoIncrement);
	}

	public void setIsAutoIncrementStr(String isAutoIncrementStr) {
		this.isAutoIncrementStr = isAutoIncrementStr;
	}
}
